package com.hw.springcloud.controller;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

import javax.annotation.Resource;

/**
 * @Classname: ConsulOrderController
 * @Description: 消费者控制器
 * @Date: 2021/7/7
 * @Author: huwei
 */
@RestController
public class ConsulOrderController {

    public static final String INVOKE_URL = "http://cloud-provider-consul-payment8006";

    @Resource
    private RestTemplate restTemplate;

    @GetMapping("/order/consul")
    public String getPayment(){
        return restTemplate.getForObject(INVOKE_URL+"/payment/consul",String.class);
    }
}
